<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script src="../js/vue.js"></script>

<body>
    <!-- <div id="app">
        {{message}} {{name}}
    </div> -->
    <div id="a">
        {{name}}
    </div>
</body>
<script>
    // var app = new Vue({
    //     el: '#app',
    //     data: {
    //         message: 'Hello Vue!',
    //         name: '曹忠牧'
    //     }
    // })


    var data = { name: '曹忠牧' };
    var vm = new Vue({
        el: '#a',
        data: data
    })
    vm.$watch('name', function (newVal,oldVal){
        console.log(newVal,oldVal);
    })

    vm.$data.name = "yyds"
    vm.$data.name = "就这啊"




</script>

</html>
